package com.nondo.rdp.stock.domain;

import com.nondo.rdp.auth.domain.User;
import com.nondo.rdp.core.domain.base.BaseEntity;

import javax.persistence.*;
import java.util.Date;

/**
 * 模拟炒股买入
 */
@Entity
@Table(name = "stock_simulate_buy")
public class SimulateBuy extends BaseEntity {
    private Long id;    //自增ID
    private User user; //用户
    private String code;//股票代码
    private String name; //股票名字
    private Date createTime;//买入时间
    private double money;//买入价格
    private int num;//买入股票数量
    private double totalMoney;//买入总价格
    private int lastNum;//剩余股票数量[因为存在卖的时候只卖一部分]

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "uid")
    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public double getMoney() {
        return money;
    }

    public void setMoney(double money) {
        this.money = money;
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    public double getTotalMoney() {
        return totalMoney;
    }

    public void setTotalMoney(double totalMoney) {
        this.totalMoney = totalMoney;
    }

    public int getLastNum() {
        return lastNum;
    }

    public void setLastNum(int lastNum) {
        this.lastNum = lastNum;
    }
}
